<?php

	$nav = array("Home" => "", "Admin" => "admin/");
	$tpl->assign("dsfm_nav", $nav);

	$table = new Table( array(
		"id" => array(
			"width" => 20,
			"title" => "ID",
			"type" => "order",
		),
		"username" => array(
			"width" => 100,
			"type" => "text",
			"link" => 'edit.php?id=$id',
		),
		"name" => array(
			"width" => 150,
			"type" => "text",
		),
		"email" => array(
			"width" => 200,
			"type" => "text"
		)
	));

	$sql = "SELECT * FROM admin ";
	$rss = $db->query($sql);

	$data = new Data($rss);

	$table->add_data($data->fetch());

	$table->add_menu( array(
		"Add New" => array(
			"link" => "form.php",
			"icon" => "add.png"
		)
	));

	$table->add_tool( array(
		"edit" => array(
			"link" => 'edit.php?id=$id',
			"icon" => "edit.png"
		),

		"delete" => array(
			"link" => 'delete.php?id=$id',
			"icon" => "delete.png"
		)
	));

	$table->rain_display($tpl, "table");
?>